package com.yami.shop.mystery.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.common.util.PageParam;
import com.yami.shop.mystery.common.dto.ActivityPresellDto;
import com.yami.shop.mystery.common.model.ActivityRule;
import com.yami.shop.mystery.common.vo.ActivityRulePageVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 活动规则数据接口
 * @author wxf
 * @date 2023/4/17 9:42
 */
public interface ActivityRuleMapper extends BaseMapper<ActivityRule> {

    /**
     * 预售活动份分页
     *
     * @param dto
     * @return
     */
    IPage<ActivityRule> pageList(PageParam<ActivityRule> page, @Param("dto") ActivityRulePageVo dto);

    /**
     *  保存/修改活动规则
     *
     * @param dto
     * @return
     */
    boolean saveOrUpdate(ActivityPresellDto dto);

    /**
     * 更新规则据状态
     *
     * @param ruleId
     * @param status
     * @return
     */
    int updateStatus(@Param("ruleId") String ruleId,@Param("status") String status);
}
